﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SEAM.Data
{
    public class ReturnCode
    {
        private int _Value;
        public int Value
        {
            get { return _Value; }
        }

        public ReturnCode(int Value)
        {
            _Value = Value;
        }

        public override bool Equals(object obj)
        {
            if (obj == null || obj.GetType() != typeof(ReturnCode))
                return false;
            return this == (ReturnCode)obj;
        }
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
        public static implicit operator ReturnCode(int Value)
        {
            return new ReturnCode(Value);
        }
        public static implicit operator int(ReturnCode RetCode)
        {
            return RetCode.Value;
        }
        public static bool operator ==(ReturnCode RetCode1, ReturnCode RetCode2)
        {
            return RetCode1.Value == RetCode2.Value;
        }
        public static bool operator !=(ReturnCode RetCode1, ReturnCode RetCode2)
        {
            return RetCode1 != RetCode2;
        }

        public const int Unknown = int.MinValue;
        public const int Success = 0;
        public const int NoSelect = 1;
        public const int NoInsert = 2;
        public const int NoUpdate = 3;
        public const int NoDelete = 4;
    }
}
